//
//  UIView+Extension.swift
//  FreshQiao2.0
//
//  Created by 邝子涵 on 2017/6/23.
//  Copyright © 2017年 上海仁菜网络科技有限公司. All rights reserved.
//

import UIKit

extension UIView {

//    // MARK: - 设置圆角
//    func setViewBorder(cornerRadius:CGFloat = 3, color:UIColor) {
//        self.layer.masksToBounds = true
//        self.layer.cornerRadius = cornerRadius
//        self.layer.borderColor = color.cgColor;
//        self.layer.borderWidth = 1;
//        self.layer.shouldRasterize = true
//        self.layer.rasterizationScale = self.layer.contentsScale
//    }
//    
//    func setViewBorderWidth(_ borderWidth:CGFloat = 1, _ borderColor:UIColor) {
//        self.layer.borderColor = borderColor.cgColor;
//        self.layer.borderWidth = borderWidth;
//    }
//
//    func setViewShadowColor(shadowOpacity:Float,shadowColor:UIColor,shadowOffset:CGSize) {
//        
//        self.layer.shadowOpacity = shadowOpacity
//        self.layer.shadowColor = shadowColor.cgColor
//        self.layer.shadowOffset = shadowOffset
//    }
//    
//    class func changeMaskLayer(rect:CGRect ,make: CGSize, corners: UIRectCorner) -> CAShapeLayer {
//        let maskPath = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: make)
//        let maskLayer = CAShapeLayer()
//        maskLayer.frame = rect
//        maskLayer.path = maskPath.cgPath
//        return maskLayer
//    }
//    
//    func setViewController() -> UIViewController? {
//        var next:UIView? = self
//        repeat{
//            if let nextResponder = next?.next {
//                if nextResponder.isKind(of: UIViewController.self) {
//                    return (nextResponder as! UIViewController)
//                }
//            }
//            next = next?.superview
//        }while next != nil
//        return nil
//    }
    
}
